home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 610 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: phoenix.rhein.de!yaps!arno
  2. From: arno@yaps.rhein.de (Arno Eigenwillig)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Message-ID: <VBzVx*M3f@yaps.rhein.de>
  6. Date: Tue, 09 Jan 1996 14:15:21 +0100
  7. References: <john.hendrikx.40ka@grafix.xs4all.nl> <jasonb.820051107@cs.uwa.edu.au>
  8.  <4c9i2l$h3i@sunsystem5.informatik.tu-muenchen.de> <4ck47h$g07@maureen.teleport.com>
  9.  <19960106.4EE928.CF59@sisyphus.demon.co.uk> <4cokkg$415@maureen.teleport.com>
  10.  <19960107.533250.14585@sisyphus.demon.co.uk> <4cqrti$f6u@maureen.teleport.com>
  11. Organization: Yet Another Private Site in Meckenheim, Germany
  12. X-Copyright: This article may not be distributed on a CD-ROM
  13.  or in printed form without prior written consent of the author.
  14. X-Newsreader: Arn V 1.04
  15.  
  16. In article <4cqrti$f6u@maureen.teleport.com>, Stephan Schaem writes:
  17.  
  18. >  I dunno , I just find it puzzling to declar variable without giving
  19. >  a care of what its usage will be. You programing practice is VERY unwise...
  20.  
  21. Don't distract, this was not the point. Intentional misunderstandings
  22. prove nothing.
  23.  
  24. >  programing on asuption (polymorphism?)
  25.  
  26. That I'd call "spelling on assumption". :)
  27.  
  28. >  If the header file was programmed correctly it would not use ANSI data
  29. >  type directly....
  30.  
  31. What are you talking about? <time.h> is provided as part of the
  32. compiler. The compiler is a beast that translates a valid C source
  33. code defining an algorithm for an abstract machine into actual machine
  34. code for an actual machine.
  35.  
  36. The semantics of the abstract machine are that there are some simple
  37. types (short, int, long, unsigned short, unsigned int, unsigned long,
  38. char, signed char, unsigned char, float, double, long double). You can
  39. derive compound types from simple or compund types (structs, unions,
  40. arrays, pointers). Additionally there are function pointers.
  41.  
  42. Then there are objects of these types and operations on these objects.
  43. Certain guarantees about the properties of types and operations are
  44. made.
  45.  
  46. Then there is clock_t (and similar beasts like size_t, prtdiff_t).
  47. clock_t is a typedef for one out of a set of simple types, but it is
  48. not said which one. Again, there are objects of type clock_t and
  49. operations defined for them with specific semantics.
  50.  
  51. The idea behind clock_t is that it is a data type suitable for storage
  52. of the system's clock's value and certain operations on it. These
  53. operations are defined in an abstract way, independant of a specific
  54. choice what simple type clock_t may actually be.
  55.  
  56. The obvious advantage is that these conception of the abstract machine
  57. allows C source code to be portable to many different actual machines,
  58. no matter what strange encoding they use for clock_t.
  59.  
  60. Dave called it "polymorphism". I call it "data encapsulation". Anyway,
  61. it's a basic concept of decent programming, and not having understood
  62. it is no crime, but one probably shouldn't go around demonstrating it
  63. everywhere in the most embarrassing way. Eh?
  64.  
  65. -- __
  66. __/// Arno Eigenwillig /\ <arno@yaps.rhein.de> \/ PGP key available.
  67. \XX/   V+49-2225-5870  /\ <Arnooo @ #amigager> \/ MIME 8bit welcome.
  68.